package cn.wolfcode.web.controller;//package cn.wolfcode.web.controller;
//
//import cn.wolfcode.domain.Result;
//import cn.wolfcode.service.EmpService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.Mapping;
//import org.springframework.web.bind.annotation.PostMapping;
//
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.servlet.http.Cookie;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
//@RestController
//public class CookieController {
//
//    @GetMapping("/c1")
//    public Result login(HttpServletResponse resp){
//       resp.addCookie(new Cookie("username","ZHouTong"));
//      return Result.success();
//    }
//
//    @GetMapping("/c2")
//    public Result getParam(HttpServletRequest req){
//        Cookie[] cookies = req.getCookies();
//        for (Cookie cookie : cookies) {
//            if (cookie.getName().equals("username")){
//                System.out.println(cookie.getValue());
//            }
//        }
//        return Result.success();
//    }
//}
